﻿Public Class TableInfo

    Public TableName As String

    Public ReadOnly Property ViewName() As String
        Get
            Dim myViewName As String = "vw" & TableName
            Return myViewName
        End Get
    End Property

    Private _FieldInfos As Dictionary(Of String, FieldInfo)
    Public ReadOnly Property FieldInfos() As Dictionary(Of String, FieldInfo)
        Get
            Dim myFieldInfo As Dictionary(Of String, FieldInfo) = _FieldInfos
            If myFieldInfo Is Nothing Then
                myFieldInfo = New Dictionary(Of String, FieldInfo)
                _FieldInfos = myFieldInfo
            End If
            Return myFieldInfo
        End Get
    End Property

End Class

Public Class FieldInfo

    Public FieldName As String
    Public IsNullable As Boolean
    Public DataType As String
    Public CharacterMaxLength As Integer
    Public NumericPrecision As Integer
    Public CharacterSet As String
    Public CollationName As String
    Public OrdinalPosition As Integer

    Private _ForeignKeyInfos As Dictionary(Of String, ForeignKeyInfo)
    Public ReadOnly Property ForeignKeyInfos() As Dictionary(Of String, ForeignKeyInfo)
        Get
            Dim myForeignKeyInfo As Dictionary(Of String, ForeignKeyInfo) = _ForeignKeyInfos
            If myForeignKeyInfo Is Nothing Then
                myForeignKeyInfo = New Dictionary(Of String, ForeignKeyInfo)
                _ForeignKeyInfos = myForeignKeyInfo
            End If
            Return myForeignKeyInfo
        End Get
    End Property

End Class

Public Class ForeignKeyInfo

    Public PrimaryKey_ColumnName As String
    Public PrimaryKey_TableName As String

End Class
